<?php defined('BASEPATH') OR die('No direct access allowed.');
/**
 * Description of "edit-row-accounts"
 *
 * Created on Jan. 17, 2011
 * @author Ramon Gutierrez
 * @copyright Bitstop Network Services Inc.
 * @version 0.1
 */
?>

                <div><a id="item<?php echo $id; ?>" name="item<?php echo $id; ?>"></a></div>
                <div class="row">
                  <div class="counter"><span><?php echo $i; ?></span></div>
                  <?php if($this->session->userdata('account_type') == 'site_admin'): ?>
                  <div>
                    <span class="label"><?php echo $this->lang->line('company'); ?></span>
                    <input class="standard" style="font-weight: bold; color: #053568; background-color: #E0E0E0;" type="text" size="25" readonly="readonly" name="company<?php echo $id; ?>" value="<?php echo $company; ?>" maxlength="32" />
                  </div>
                  <?php endif; ?>
                  <div class="firstcol">
                    <div>
                      <span class="label"><?php echo $this->lang->line('account_type'); ?></span>
                      <input class="standard" style="font-weight: bold; color: #053568; background-color: #E0E0E0;" type="text" size="25" readonly="readonly" name="account_type<?php echo $id; ?>" value="[<?php echo ucfirst($account_type); ?>]" maxlength="32" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('first_name'); ?></span>
                      <input class="standard" style="font-weight: bold;" type="text" size="25" name="first_name<?php echo $id; ?>" value="<?php echo $first_name; ?>" maxlength="32" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('last_name'); ?></span>
                      <input class="standard" style="font-weight: bold;" type="text" size="25" name="last_name<?php echo $id; ?>" value="<?php echo $last_name; ?>" maxlength="32" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('username'); ?></span>
                      <input class="standard" style="font-weight: bold;" type="text" size="25" name="username<?php echo $id; ?>" value="<?php echo $username; ?>" maxlength="32" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('change_password'); ?></span>
                      <input class="standard" style="font-weight: bold;" type="password" size="25" name="password<?php echo $id; ?>" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('change_confirm'); ?></span>
                      <input class="standard" style="font-weight: bold;" type="password" size="25" name="confirm<?php echo $id; ?>" />
                    </div>
                    <?php if($account_type == 'agent'): ?>
                    <div>
                      <span class="label"><?php echo $this->lang->line('assigned_branch'); ?></span>
                      <select class="standard" name="branch_id<?php echo $id; ?>" id="branch_id<?php echo $id; ?>">
                      <?php foreach($branches->result_array() as $row): ?>
                      <?php $selected = ($row['id'] == $agent['branch_id'] ? ' selected="selected"' : ''); ?>
                      <?php echo '<option value="' . $row['id'] . '"' . $selected . '>' . $row['name'] . '</option>'; ?>
                      <?php endforeach; ?>
                      </select>
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('assigned_service'); ?></span>
                      <select multiple="multiple" class="checklist" title="<?php echo $this->lang->line('assigned_service_select'); ?>" name="services<?php echo $id; ?>[]" id="services<?php echo $id; ?>">
                      <?php foreach($services->result_array() as $row): ?>
                      <?php $selected = (in_array($row['id'], $agent['services']) ? ' selected="selected"' : ''); ?>
                      <?php echo '<option value="' . $row['id'] . '"' . $selected . '>' . $row['title'] . '</option>'; ?>
                      <?php endforeach; ?>
                      </select>
                    </div>
                    <?php elseif($account_type == 'manager'): ?>
                    <div>
                      <span class="label"><?php echo $this->lang->line('assigned_branch'); ?></span>
                      <input class="standard" style="font-weight: bold; color: #053568; background-color: #E0E0E0;" type="text" size="25" readonly="readonly" name="branch_name<?php echo $id; ?>" value="<?php echo $branch_name; ?>" maxlength="32" />
                    </div>
                    <?php endif; ?>
                  </div>
                  <div class="nextcol">
                    <div>
                      <span class="label"><?php echo $this->lang->line('street_address'); ?></span>
                      <input class="standard" type="text" size="50" name="street_address<?php echo $id; ?>" value="<?php echo $street_address; ?>" maxlength="128" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('city'); ?></span>
                      <input class="standard" type="text" size="50" name="city<?php echo $id; ?>" value="<?php echo $city; ?>" maxlength="128" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('state'); ?></span>
                      <input class="standard" type="text" size="50" name="state<?php echo $id; ?>" value="<?php echo $state; ?>" maxlength="128" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('country'); ?></span>
                      <select class="standard" name="country_id<?php echo $id; ?>" id="country_id<?php echo $id; ?>">
                      <?php foreach($countries->result_array() as $row): ?>
                      <?php $selected = ($row['id'] == $country_id ? ' selected="selected"' : ''); ?>
                      <?php echo '<option value="' . $row['id'] . '"' . $selected . '>' . $row['name'] . " ($row[abbreviation])" . '</option>'; ?>
                      <?php endforeach; ?>
                      </select>
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('zipcode'); ?></span>
                      <input class="standard" type="text" size="15" name="zip<?php echo $id; ?>" value="<?php echo $zip; ?>" maxlength="10" />
                    </div>
                    <div>
                      <span class="label"><?php echo $this->lang->line('contact_number'); ?></span>
                      <input class="standard" type="text" size="25" name="contact_number<?php echo $id; ?>" value="<?php echo $contact_number; ?>" maxlength="32" />
                    </div>
                    <div>
                    <span class="label"><?php echo $this->lang->line('email'); ?></span>
                      <input class="standard" type="text" size="25" name="email<?php echo $id; ?>" value="<?php echo $email; ?>" maxlength="64" />
                    </div>
                    <input type="hidden" name="i<?php echo $id; ?>" value="<?php echo $i; ?>" />
                  </div>
                  <div class="clear"></div>
                </div>
